package cn.nohan.funplay.module.member.mongo.controller;

import cn.nohan.funplay.module.member.mongo.annotation.ResponseResult;
import cn.nohan.funplay.module.member.mongo.annotation.ResultListNotNull;
import cn.nohan.funplay.module.member.mongo.entity.TestDemo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * @author caozhipeng
 * @date 2025/7/21
 */
@RestController
@RequestMapping("/test")
//@ResponseResult
@ResultListNotNull
public class TestController {

    @GetMapping("/list")
    public List<String> getList(){
        return Arrays.asList("Hello","DDDD","CCCC");
    }

    @GetMapping("/list4")
    public List<String> getList4(){
        return Collections.emptyList();
    }

    @GetMapping("/list5")
    public List<String> getList5(){
        return null;
    }

    @GetMapping("/list2")
    public TestDemo getList2(){
        TestDemo testDemo = new TestDemo();
        testDemo.setName("Hello");
        testDemo.setName2(null);
        testDemo.setList1(Arrays.asList("111","222","333"));
        testDemo.setList2(Arrays.asList("444","555","666"));
        return testDemo;
    }

    @GetMapping("/list3")
    public TestDemo getList3(){
        TestDemo testDemo = new TestDemo();
        testDemo.setName("Hello");
        testDemo.setName2(null);
        testDemo.setList1(Collections.emptyList());
        testDemo.setList2(null);
        return testDemo;
    }

    @GetMapping("/name1")
    public String getName1(){
        return "Hello";
    }
    @GetMapping("/name2")
    public String getName2(){
        return "";
    }
    @GetMapping("/name3")
    public String getName3(){
        return null;
    }



}
